package com.kx.test;

import com.kx.my05.SomeService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyTest05 {
    @Test
    public void test(){
        String config="applicationContext.xml";
        ApplicationContext ctx=new ClassPathXmlApplicationContext(config);
        SomeService proxy= (SomeService) ctx.getBean("someService");

//        System.out.println("proxy:"+proxy.getClass().getName());
        //通过代理对象执行方法，实现目标方法执行时，增强了功能
        proxy.doSecond();
    }
}
